<!--3级平行轴传动比分配 -->
<template>
<div class="sum" style="width: 100%;height: 100%">
  <a-row class="all" style="height: 100%">
<!--    <a-row class="title" style="height: 4%;background-color: black"><strong ><label style="display: block;margin-top: 0.3%;color: white;margin-left: 1%">3级平行轴传动比分配</label></strong></a-row>-->
<!--    <a-row class="file" style="height: 3.5%;background: #f2f2f2"><label style="margin-left: 1%">文件</label></a-row>-->
    <a-row class="top" style="height: 54.5%">
      <a-col class="left_top" :span="9" style="height: 100%;">
       <a-col :span="20" style="height: 100%">
         <a-row style="height: 6%"><div style="width: 85%;background-color: #f2f2f2;margin: 0 auto"><label style="width: 80%">输入参数</label></div></a-row>
         <a-col :span="2" style="height: 100%"></a-col>
         <a-col :span="20" style="height: 100%">
         <div style="height: 94%">
            <a-row style="height: 50%">
              <a-col :span="12" style="height: 100%">
                <div style="height: 100%;margin-top:4%;text-align: right;margin-right: 5%">
              <a-row style="height: 33.3%">总传动比</a-row>
              <a-row style="height: 33.3%">宽径比上限值</a-row>
              <a-row style="height: 33.4%">平行轴单级齿数比限制值</a-row>
                </div>
              </a-col>
              <a-col class="input" :span="12" style="height: 100%">
                <div style="height: 100%;margin-top:4%">
                  <a-row style="height: 33.3%"><input style="text-align: center" v-model="input_data.R0"/></a-row>
                  <a-row style="height: 33.3%"><input style="text-align: center" v-model="input_data.B1min"/></a-row>
                  <a-row style="height: 33.4%" ><input style="text-align: center" v-model="input_data.ratio_parallel"/></a-row>
                </div>
              </a-col>
            </a-row>
            <a-row style="height: 50%">
              <a-row style="height: 50%">
                <a-col :span="6" style="height: 100% ">
                  <a-col :span="16" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <input style="height:40%;width: 100%;margin-top: 35%;text-align: center" v-model="input_data.ratio_D1_D2_min"/>
                    </div>
                  </a-col>
                  <a-col :span="8" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <label style="display: block;height:60%;width: 100%;margin-top: 70%;font-size: 20px;text-align: center">≦</label>
                    </div>
                  </a-col>
                </a-col>
                <a-col :span="12" style="height: 100%">
                  <div style="height: 100%;width: 100%;font-size: 15px;margin-left: 10%">
                  <a-row style="height: 30%"></a-row>
                  <a-row style="height: 10%;margin-left: 22%"><label>低速级外径</label></a-row>
                  <a-row style="height: 10%">---------------------</a-row>
                  <a-row style="height: 50%;margin-left: 22%">中间级外径</a-row>
                  </div>
                </a-col>
                <a-col :span="6" style="height: 100%">
                  <a-col :span="8" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <label style="display: block;height:60%;width: 100%;margin-top: 70%;font-size: 20px;text-align: center;">≦</label>
                    </div>
                  </a-col>
                  <a-col :span="16" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <input style="height:40%;width: 100%;margin-top: 35%;text-align: center" v-model="input_data.ratio_D1_D2_max"/>
                    </div>
                  </a-col>
                </a-col>
              </a-row>
              <a-row style="height: 50%">
                <a-col :span="6" style="height: 100% ">
                  <a-col :span="16" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <input style="height:40%;width: 100%;margin-top: 35%;text-align: center" v-model="input_data.ratio_D2_D3_min"/>
                    </div>
                  </a-col>
                  <a-col :span="8" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <label style="display: block;height:60%;width: 100%;margin-top: 70%;font-size: 20px;text-align: center">≦</label>
                    </div>
                  </a-col>
                </a-col>
                <a-col :span="12" style="height: 100%">
                  <div style="height: 100%;width: 100%;font-size: 15px;margin-left: 10%">
                    <a-row style="height: 30%"></a-row>
                    <a-row style="height: 10%;margin-left: 22%"><label>中间级外径</label></a-row>
                    <a-row style="height: 10%">---------------------</a-row>
                    <a-row style="height: 50%;margin-left: 22%">高速级外径</a-row>
                  </div>
                </a-col>
                <a-col :span="6" style="height: 100%">
                  <a-col :span="8" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <label style="display: block;height:60%;width: 100%;margin-top: 70%;font-size: 20px;text-align: center;">≦</label>
                    </div>
                  </a-col>
                  <a-col :span="16" style="height: 100%">
                    <div style="width: 100%;height: 100%">
                      <input style="height:40%;width: 100%;margin-top: 35%;text-align: center" v-model="input_data.ratio_D2_D3_max"/>
                    </div>
                  </a-col>
                </a-col>
              </a-row>
            </a-row>
       </div>
       </a-col>
         <a-col :span="2" style="height: 100%"></a-col>
       </a-col>
       <a-col :span="4" class="bt" style="height: 100%">
<!--         <div style="width: 100%;height: 100%">-->
         <input type="button" value="计算" style="width: 70%;height:10%;margin-top:315%;background: #6DD400" @click="func" />
<!--           <button  style="width: 80%" @click="func">计算</button>-->
<!--         </div>-->
       </a-col>
      </a-col>
      <a-col class="right_top_img" :span="15" style="height: 100%">
        <img src="@/assets/image/image_64_1.jpg" style="width: 80%;height: 95%;margin-left: 5%;margin-top: 0.8%" />
      </a-col>
    </a-row>
    <a-row class="mid" style="height: 23%">
      <a-row style="height: 12%"><div style="width: 100%;background-color: #f2f2f2;height: 100%">
        <label style="width: 100%;display: block;margin-left: 2.5%">以外径最小为目标函数</label></div>
      </a-row>
      <a-row style="height: 88%;width: 100%">
         <table style="width: 100%;height: 100%;margin-left: 1%">
           <tr style="height: 50%;width: 100%;">
             <th>低速级齿数比</th>
             <th>中间级齿数比</th>
             <th>高速级齿数比</th>
             <th>总体积表征量</th>
             <th>低速级外半径表征量</th>
             <th>中间级外半径表征量</th>
             <th>高速级外半径表征量</th>
             <th>低速级小轮实际宽径比</th>
             <th>中间级小轮实际宽径比</th>
             <th>高速级小轮实际宽径比</th>
             <th>低速级与中间级齿宽比</th>
             <th>中间级与高速级齿宽比</th>
           </tr>
           <tr  style="height: 50%;width: 100%; border: 1px solid #D7D7D7" v-for="(item,index) in result_DAta.rm_V" :key="index">
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[0]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[1]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[2]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[3]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[4]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[5]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[6]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[7]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[8]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[9]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[10]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[11]}}</span></td>
             <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative"><span style="position:absolute;top: 5%">{{item[12]}}</span></td>
           </tr>
         </table>
      </a-row>
    </a-row>
    <a-row class="foot" style="height: 22.5%">
      <a-col :span="8" style="height: 100%">
        <a-row style="height: 11%"><div style="width: 100%;background-color: #f2f2f2;height: 100%">
          <label style="width: 100%;display: block;margin-left: 5%;">以体积最小为目标函数</label></div>
        </a-row>
        <a-row style="height: 89%">
          <table style="width: 100%;height: 100%;margin-left: 3%">
            <tr style="height: 50%;width: 100%;margin-left: 2%">
              <th>低速级齿数比</th>
              <th>中间级齿数比</th>
              <th>高速级齿数比</th>
              <th>总体积表征量</th>
            </tr>
            <tr  style="height: 50%;width: 100%;border: solid 1px #D7D7D7" v-for="(item,index) in result_DAta.rm_D" :key="index">
              <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative;margin-left: 2%"><span style="position:absolute;top: 5%">{{item[0]}}</span></td>
              <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative;margin-left: 2%"><span style="position:absolute;top: 5%">{{item[1]}}</span></td>
              <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative;margin-left: 2%"><span style="position:absolute;top: 5%">{{item[2]}}</span></td>
              <td style="height: 5%;padding-top: 0;line-height: 10px;position: relative;margin-left: 2%"><span style="position:absolute;top: 5%">{{item[3]}}</span></td>
            </tr>
          </table>
        </a-row>
      </a-col>
     <a-col :span="16" style="height: 100%"></a-col>
    </a-row>
  </a-row>
</div>

</template>

<script>

import {optiRatio_threeparallel_last} from "@/api/file";

export default {
name: "OptiRatio_threeparallel_last",
  created() {
    document.title='三级平行轴传动比分配'
  },
  data() {
    return {
    input_data:{//输入参数
        R0: '15',
        ratio_parallel: '6',
        B1min: '1',
        ratio_D1_D2_min: '1',
        ratio_D1_D2_max: '1.2',
        ratio_D2_D3_min: '1',
        ratio_D2_D3_max: '1.2',
      },
      result_DAta:{//输出参数
        rm_D:[[]],
        rm_V:[[]],
      }
    }
  },
  methods :{
  func(){//计算
    optiRatio_threeparallel_last(this.input_data).then(res =>{
    // this.result_DAta.result1=res[1]
    // this.result_DAta.result2=res[0]
    this.result_DAta=res;
    console.log(res)
  }).catch(err =>{
    this.$message.error(err);
  });
  },
  }
}
</script>

<style scoped>
table tr:nth-child(odd)
{
  background-color:#ffffff;
}

table  tr:nth-child(even)
{
  background-color:#f1f1f1;
}


</style>
